package com.qen.configuration;

import com.qen.enums.IfExistsEnum;
import com.qen.enums.IfExistsSqlKeyWordEnum;

import java.util.function.BiPredicate;

/**
 * @author licz
 * @since 1.0.0
 */
public class JoinProperties {

    /**
     * 是否开启副表逻辑删除
     */
    public static boolean subTableLogic = true;

    /**
     * 表别名
     */
    public static String tableAlias = "t";

    /**
     * 子查询别名
     */
    public static String subQueryAlias = "st";
    /**
     * Wrapper IfExists 判断策略
     * <p>
     * NOT_NULL 非null
     * <p>
     * NOT_EMPTY 非空字符串   例： "" -> false, " " -> true ...
     * <p>
     * NOT_BLANK 非空白字符串  例： "" -> false, " " -> false, "\r" -> false, "abc" -> true ...
     */
    public static BiPredicate<Object, IfExistsSqlKeyWordEnum> ifExists = (val, key) -> IfExistsEnum.NOT_EMPTY.test(val);

}
